togglebutton: Fix actionable state tracking
authorMatthias Clasen <mclasen@redhat.com>
Thu, 10 Jun 2021 12:36:08 +0000 (08:36 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 10 Jun 2021 12:36:08 +0000 (08:36 -0400)
If we have a GAction as model, we just have to let
the action helper handle the state updates. GtkButton
already calls gtk_action_helper_activate() for us.

gtk/gtktogglebutton.c

index 4ea135ee482dcf884324e30469b682c7cdf7247f..1774508bc5f69fdc41189f481ffe8bdb77eb2364 100644 (file)
@@ -202,6 +202,9 @@ gtk_toggle_button_clicked (GtkButton *button)
   if (priv->active && (priv->group_prev || priv->group_next))
     return;
 
+  if (gtk_button_get_action_helper (button))
+    return;
+
   gtk_toggle_button_set_active (toggle_button, !priv->active);
 }